import axiosServer from '../utils/request'

/**
 * 每日推荐（！！！需要登录）
 * @returns 
 */
export const RequestrRecommendList = () => {
    return axiosServer({
        method: 'get',
        url:'/recommend/songs',
    })
}


/**
 * 精品歌单标签列表
 * @returns 
 */
export const RequestSongsTitle = ()=>{
    return axiosServer({
        method:'get',
        url:'/playlist/highquality/tags',
    })
}

/**
 * 获取精品歌单
 * @param cat 
 * @param limit 
 * @returns 
 */
export const RequestAllSongs = ( cat: string, limit: number )=>{
    return axiosServer({
        method:'get',
        url:'/personalized',
        params: { cat, limit }
    })
}

/**
 * 新歌速递
 * @param type
 * @returns 
 */
export const RequestNewSongs = ( type: number ) => {
    return axiosServer({
        method: 'get',
        url: '/top/song',
        params: { type }
    })
}

/**
 * 网友精选碟
 * @param order 
 * @param limit 
 * @returns 
 */
export const RequestSelected = ( order: string, limit: number ) => {
    return axiosServer({
        method: 'get',
        url: '/top/playlist',
        params: { order, limit }
    })
}

/**
 * 推荐歌单
 * @param limit 
 * @returns 
 */
export const RequestRecommend = (limit: number) => {
    return axiosServer({
        method: 'get',
        url: '/personalized',
        params: { limit }
    })
}

/**
 * 雷达歌单（！！！登陆后无）
 * @returns 
 */
export const RequestRadarSongsSteet = () => {
    return axiosServer({
        method: 'get',
        url: '/homepage/block/page',
    })
}

export const RequestBanner = ( type: number ) => {
     return axiosServer({
        method: 'get',
        url: '/banner',
        params: { type }
    })
}

/**
 * 获取歌单所有歌曲
 * @param id 
 * @param limit 
 * @returns 
 */
export const RequestSteetAllSongs = ( id: number, limit: number ) => {
    return axiosServer({
        method:"get",
        url:"/playlist/track/all",
        params:{id,limit}
    })
}

/**
 * 歌单详情
 * @param id 
 * @returns 
 */
export const RequestSteetDetail = ( id: number ) => {
    return axiosServer({
        method:"get",
        url:"/playlist/detail",
        params:{id}
    })
}


/**
 * 获取用户歌单
 * @param uid 
 * @returns 
 */
export const RequestUserSteet = (uid: number) => {
    return axiosServer({
        method:'get',
        url:'/user/playlist',
        params: { uid }
    })
}

/**
 * 收1藏/取消2歌单
 * @param t 
 * @param id 
 * @returns 
 */
export const RequestGetAndCancelSteet = (t: number, id: number) => {
    return axiosServer({
        method: 'get',
        url: '/playlist/subscribe',
        params: { t, id }
    })
}

/**
 * 获取全部MV
 * @param area 
 * @returns 
 */
export const RequestAllMV = (area: string, limit: number) => {
    return axiosServer({
        method: 'get',
        url: '/mv/all',
        params: { area, limit }
    })
}

/**
 * 获取MV地址
 * @param area 
 * @returns 
 */
 export const RequestMVUrl = (id: number) => {
    return axiosServer({
        method: 'get',
        url: '/mv/url',
        params: { id }
    })
}